Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to parse the year when 'year' tag could be a date #104

Merged
merged 5 commits into from
Apr 17, 2024
Merged

Try to parse the year when 'year' tag could be a date #104

merged 5 commits into from
Apr 17, 2024

Conversation

JorgeLNJunior
Copy link
Contributor

When the year/date tag is a date, it can't be parsed into a number, so the Year() method returns a zero value. This PR tries to fix this by checking if the Atoi() function returns 0. If it does, the string is parsed as a date, and the year is returned. If parsing fails, it still returns zero.

Copy link
Owner

@dhowden dhowden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change! Slight simplification to make it more clear that we're not changing behaviour when year = 0 (nonsense though that would be!).

id3v2metadata.go Outdated Show resolved Hide resolved
Co-authored-by: David Howden <dhowden@gmail.com>
@dhowden
Copy link
Owner

dhowden commented Apr 13, 2024

So I completely missed that the build was failing on here! time.DateOnly is go1.20+, will bump the version in go.mod.

@dhowden
Copy link
Owner

dhowden commented Apr 13, 2024

...and I can't fix this it would seem. Can you bump the go.mod to 1.20 as that's the requirement for this?

@JorgeLNJunior
Copy link
Contributor Author

Done.

@JorgeLNJunior
Copy link
Contributor Author

I forgot the workflow file, now it should pass.

.github/workflows/go.yml Outdated Show resolved Hide resolved
@dhowden dhowden merged commit 3d75831 into dhowden:master Apr 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants